#pragma once

#include "Matrix.h"
#include "Material.h"
#include "ShaderManager.h"

struct IndexedPrimitiveInfo
{
	LPDIRECT3DVERTEXBUFFER9	m_pVB;
	LPDIRECT3DINDEXBUFFER9	m_pIB;

	unsigned int			m_stride;
	DWORD					m_fvf;

	D3DPRIMITIVETYPE		m_primitiveType;

	int						m_baseVertexIndex;
	unsigned int			m_minIndex;
	unsigned int			m_numVertices;
	unsigned int			m_startIndex;
	unsigned int			m_triangleCount;
};

struct Val3DRendererUnit
{	
	Matrix m_worldTransform;

	Material * m_material;

	IndexedPrimitiveInfo m_indexedPrimitiveInfo;
};

class Val3DRenderer
{
public:
	Val3DRenderer(void);
	~Val3DRenderer(void);

public:
	void Init();
	void Flush();

public:
	ShaderManager * GetShaderManager() { return m_shaderManager; }

public:
	void AddQueueVal3DRendererUnit( Val3DRendererUnit & unit );

public:
	void RenderImmediately( Val3DRendererUnit & unit );


private:
	ShaderManager * m_shaderManager;
};
